package com.zb.mobile;

import com.zb.annotation.NumberPattern;
import com.zb.utils.VerificUtil;
import com.zb.vo.WithdrawOrderVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.util.List;

/**
 * @Author WEN
 * @Date 2024/5/28 0028
 **/
@Data
@ApiModel("提现单对象")
public class WithdrawMobileVo {
    @ApiModelProperty(value = "提现单ID，修改必传，新增不必传")
    private Long id;

    @NotBlank(message = "银行卡名称不能为空")
    @Length(max = 20, message = "银行卡名称长度限制20个字符")
    @ApiModelProperty(value = "银行卡名称", required = true)
    private String name;

    @NotBlank(message = "银行卡号不能为空")
    @Length(max = 60, message = "银行卡号长度限制60个字符")
    @ApiModelProperty(value = "银行卡号", required = true)
    private String bankNo;

    @Length(max = 100, message = "开户行长度限制100个字符")
    @ApiModelProperty(value = "开户行")
    private String openingBank;

    @NotBlank(message = "持卡人姓名不能为空")
    @Length(max = 100, message = "持卡人姓名长度限制100个字符")
    @ApiModelProperty(value = "持卡人姓名", required = true)
    private String cardholderName;

    @Length(max = 100, message = "申请备注长度限制100个字符")
    @ApiModelProperty(value = "申请备注")
    private String applyRemark;

    @NotNull(message = "提现手续费策略不能为空")
    @NumberPattern(regexp = "^(1|2)$", required = true, message = "提现手续费策略参数不合法")
    @ApiModelProperty(value = "提现手续费策略：1-按比例收取(按提现总金额计算)，2-每间固定(按每单总金额计算)", required = true, example = "1")
    private Integer withdrawHandlingFeeStrategy;

    @NotNull(message = "手续费比例不能为空")
    @NumberPattern(regexp = VerificUtil.FLOATING_NUMBER_10_2, message = "手续费比例最多允许输入8位整数，两位小数")
    @ApiModelProperty(value = "手续费比例，单位为%，当withdrawHandlingFeeStrategy=1时生效", required = true, example = "0")
    private BigDecimal handingFeeProportion;

    @NotNull(message = "每单固定手续费不能为空")
    @NumberPattern(regexp = VerificUtil.FLOATING_NUMBER_10_2, message = "每单固定手续费最多允许输入8位整数，两位小数")
    @ApiModelProperty(value = "每单固定手续费：当withdrawHandlingFeeStrategy=2时生效", required = true, example = "0")
    private BigDecimal handingFeeFixedOrder;

    @Valid
    @NotNull(message = "提现工单不能为空，至少选择一项")
    @Size(min = 1, message = "提现工单不能为空，至少选择一项")
    @ApiModelProperty(value = "提现工单", required = true)
    private List<WithdrawOrderVo> orderVos;

    @ApiModelProperty("开户银行网点")
    private String openAccountBankNetwork;

    @ApiModelProperty("联行行号（跨行业务与行名不能同时为空）")
    private String bankCode;
}
